package com.kingsystem.kingteachermarks_backend.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kingsystem.kingteachermarks_backend.entity.ViewWorkPerformanceAllocation;
import com.kingsystem.kingteachermarks_backend.entity.WorkPerformanceFiles;
import com.kingsystem.kingteachermarks_backend.mapper.ViewWorkPerformanceAllocationMapper;
import com.kingsystem.kingteachermarks_backend.mapper.ViewWorkPerformanceMapper;
import com.kingsystem.kingteachermarks_backend.service.impl.ViewWorkPerformanceAllocationServiceImpl;
import com.kingsystem.kingteachermarks_backend.service.impl.ViewWorkPerformanceServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author leiyue_yao
 * @since 2025-08-10
 */
@Controller
@RequestMapping("/viewWorkPerformanceAllocation")
@CrossOrigin
public class ViewWorkPerformanceAllocationController {

    @Autowired
    private ViewWorkPerformanceAllocationMapper vwpam;

    @Autowired
    private ViewWorkPerformanceAllocationServiceImpl vwpai;

    @PostMapping("getAllocatdUsersById")
    @ResponseBody
    public List<ViewWorkPerformanceAllocation> getAllocatdUsersById(@RequestParam("workPerformanceId") String workPerformanceId){
        List<ViewWorkPerformanceAllocation> li = new ArrayList<>();
        QueryWrapper<ViewWorkPerformanceAllocation> qw = new QueryWrapper<>();
        qw.eq("work_performance_id", workPerformanceId);


        li = vwpai.list(qw);
        return li;
    }

}
